package com.swallow.auth.api.login;

import com.swallow.auth.api.login.dto.CaptchaDTO;
import com.swallow.auth.api.login.dto.RegisterDTO;
import com.swallow.auth.api.login.dto.SendSmsDTO;
import com.swallow.auth.common.result.Result;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author: 18310740596@163.com
 * @date: 2024-05-11 00:07:36
 * @version: v1.0
 * @describe: class responsibility
 */
@FeignClient(url = "http://localhost:10000")
@RequestMapping("/auth/v1")
public interface IAuthFacade {
    /**
     *  发送短信
     *
     * @param sendSms 请求参数
     * @return        发送短信结果
     */
    @PostMapping("smsCaptcha")
    Result<Void> smsCaptcha(@RequestBody @Valid SendSmsDTO sendSms);

    @GetMapping("picCaptcha")
    Result<CaptchaDTO> picCaptcha();


    @PostMapping("register")
    Result<String> register(@RequestBody @Valid RegisterDTO register);

}
